/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.krazevina.kar;

import com.sun.lwuit.Component;
import com.sun.lwuit.Container;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.List;
import com.sun.lwuit.TextArea;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.list.ListCellRenderer;
import com.sun.lwuit.plaf.Border;

/**
 *
 * @author XXX
 */
public class ListCellRender implements ListCellRenderer {


    public Component getListCellRendererComponent(List list, Object o, int i, boolean bln) {
        try{
            Container b = (Container)o;
            if(bln&&list.hasFocus()){
                b.getStyle().setBorder(Border.createLineBorder(3, 0x00ff00));
            }else{
                b.getStyle().setBorder(null);
                b.getStyle().setBgTransparency(0);
            }
            return b;
        }catch(Exception e){
            try{
                Label b = (Label)o;
                if(bln&&list.hasFocus()){
                    b.getStyle().setBorder(Border.createLineBorder(3, 0x00ff00));
                }else{
                    b.getStyle().setBorder(null);
                    b.getStyle().setBgTransparency(0);
                }
                return b;
            }catch(Exception ex){
                return new Label("");
            }
        }
    }
    public Component getListFocusComponent(List list) {
        return null;
    }
}
